<template>
	<div class="container">
    <div style="display:flex">
          <div class="tabItem borderColor" v-on:click="toggleTab(1);" :class="{active:isShow}">
            <a href="javascript:void(0)">分销助手</a>
          </div>
          <div class="tabItem" v-on:click="toggleTab(2);" :class="{active:!isShow}">
            <a href="javascript:void(0)">案场助手</a>
          </div>
    </div>
    <div>
      <component :is="currentView"></component>
    </div>
	</div>
</template>
<script>
  import agencyLogin from './agency/login.vue'
  import assistantLogin from './assistant/login.vue'
	export default{
        components:{
          agencyLogin,
          assistantLogin
        },
        data(){
            return {
                currentView:  window.sessionStorage.getItem("view")? window.sessionStorage.getItem("view"):'agencyLogin',
                isShow: window.sessionStorage.getItem("view") != 'assistantLogin'  ? true : false,
            }
        },
        mounted: function () {
        },
        methods: {
          toggleTab: function(tab) {
            if(2==tab){
              this.isShow =false;
              window.sessionStorage.setItem("loginType", this.utilHelper.appAssistant);
              this.currentView = 'assistantLogin';
            }else{
              this.isShow =true;
              window.sessionStorage.setItem("loginType", this.utilHelper.appAgency);
              this.currentView = 'agencyLogin';
            }
          }
        }
    }
</script>
